package com.josephxu.tank.strategy;

/**
 * @Author: Joseph Xu
 * @Date: 2022/1/25 22:13
 */
public class CatHeightComparator implements Comparator<Cat> {

    @Override
    public int compare(Cat o1, Cat o2) {
        if (o1.getHeight()>o2.getHeight()) return 1;
        else if (o1.getHeight()<o2.getHeight()) return -1;
        else return 0;
    }
}
